from playwright.sync_api import Playwright, sync_playwright


def run(playwright: Playwright) -> None:
    browser = playwright.chromium.launch(headless=False)
    context = browser.new_context()
    page = context.new_page()
    page.goto("https://m.bqgl.cc/map/")
    
    # 示例：点击小说链接
    # page.get_by_role("link", name="小说名称").click()
    
    # 示例：获取小说列表
    # novels = page.locator(".topli > li")
    # print(f"Found {novels.count()} novels")
    
    context.close()
    browser.close()


if __name__ == "__main__":
    with sync_playwright() as playwright:
        run(playwright)
